<template>
  <div class="q-pa-md q-gutter-sm">
    <t-btn label="Close Icon" color="primary" @click="icon = true" />
    <t-btn label="With QBar" color="primary" @click="bar = true" />
    <t-btn label="Another QBar" color="primary" @click="bar2 = true" />
    <t-btn label="With QToolbar" color="primary" @click="toolbar = true" />

    <t-dialog v-model="icon">
      <t-card>
        <t-card-section class="row items-center q-pb-none">
          <div class="text-h6">Close icon</div>
          <t-space />
          <t-btn icon="close" flat round dense v-close-popup />
        </t-card-section>

        <t-card-section>
          Lorem ipsum dolor sit amet consectetur adipisicing elit. Rerum
          repellendus sit voluptate voluptas eveniet porro. Rerum blanditiis
          perferendis totam, ea at omnis vel numquam exercitationem aut, natus
          minima, porro labore.
        </t-card-section>
      </t-card>
    </t-dialog>

    <t-dialog v-model="bar" persistent>
      <t-card>
        <t-bar>
          <t-icon name="network_wifi" />
          <t-icon name="network_cell" />
          <t-icon name="battery_full" />
          <div>9:34</div>

          <t-space />

          <t-btn dense flat icon="close" v-close-popup>
            <t-tooltip>Close</t-tooltip>
          </t-btn>
        </t-bar>

        <t-card-section>
          Lorem ipsum dolor sit amet consectetur adipisicing elit. Rerum
          repellendus sit voluptate voluptas eveniet porro. Rerum blanditiis
          perferendis totam, ea at omnis vel numquam exercitationem aut, natus
          minima, porro labore.
        </t-card-section>

        <t-card-section class="q-pt-none">
          Lorem ipsum dolor sit amet consectetur adipisicing elit. Rerum
          repellendus sit voluptate voluptas eveniet porro. Rerum blanditiis
          perferendis totam, ea at omnis vel numquam exercitationem aut, natus
          minima, porro labore.
        </t-card-section>
      </t-card>
    </t-dialog>

    <t-dialog
      v-model="bar2"
      persistent
      transition-show="flip-down"
      transition-hide="flip-up"
    >
      <t-card class="bg-primary text-white">
        <t-bar>
          <t-icon name="network_wifi" />
          <t-icon name="network_cell" />
          <t-icon name="battery_full" />
          <div>9:34</div>

          <t-space />

          <t-btn dense flat icon="close" v-close-popup>
            <t-tooltip class="bg-white text-primary">Close</t-tooltip>
          </t-btn>
        </t-bar>

        <t-card-section>
          <div class="text-h6">Alert</div>
        </t-card-section>

        <t-card-section class="q-pt-none">
          Lorem ipsum dolor sit amet consectetur adipisicing elit. Rerum
          repellendus sit voluptate voluptas eveniet porro. Rerum blanditiis
          perferendis totam, ea at omnis vel numquam exercitationem aut, natus
          minima, porro labore.
        </t-card-section>
      </t-card>
    </t-dialog>

    <t-dialog v-model="toolbar">
      <t-card>
        <t-toolbar>
          <t-avatar>
            <img src="https://cdn.quasar.dev/logo-v2/svg/logo.svg" />
          </t-avatar>

          <t-toolbar-title
            ><span class="text-weight-bold">Quasar</span>
            Framework</t-toolbar-title
          >

          <t-btn flat round dense icon="close" v-close-popup />
        </t-toolbar>

        <t-card-section>
          Lorem ipsum dolor sit amet consectetur adipisicing elit. Rerum
          repellendus sit voluptate voluptas eveniet porro. Rerum blanditiis
          perferendis totam, ea at omnis vel numquam exercitationem aut, natus
          minima, porro labore.
        </t-card-section>
      </t-card>
    </t-dialog>
  </div>
</template>

<script>
  import { ref } from 'vue';

  export default {
    setup() {
      return {
        icon: ref(false),
        bar: ref(false),
        bar2: ref(false),
        toolbar: ref(false),
      };
    },
  };
</script>
